package org.kosta.android.samples.part1;

import org.kosta.android.samples.R;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class ImplicitActionSamplesActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.implicit_samples);
        
        Button btnCall = (Button)findViewById(R.id.btn_call);
        btnCall.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:010-1234-5678"));
				startActivity(intent);

			}
		});
        
        Button btnMail = (Button)findViewById(R.id.btn_mail);
        btnMail.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:dohkim@nextree.co.kr"));
				startActivity(intent);

			}
		});
    }

}
